package work.atpgroup.service;

import org.apache.ibatis.annotations.Param;
import work.atpgroup.entity.Identity;
import work.atpgroup.entity.User;

import javax.annotation.Nullable;
import java.util.List;

public interface UserService {
    int insertUser(User user);
    int updateUser(User user);
    int deleteUser(Integer userId);
    User getUserByComplexNameOrId(String complexNameOrId);
    List<User> getUserByListId(@Param("id") List<Integer> id);
    int login(@Nullable String complexNameOrId, @Nullable Long password);
    void loadIdentity(User user);
    User getUserByUserId(Integer userId);
    int getUserCountByComplexName(String complexName);
    boolean haveAdministratorPermission(Integer userId);
    boolean havePermission(Integer userId, String identityName);
    boolean havePermission(Integer userId, Identity identity);
    boolean havePermission(Integer userId, Integer identityId);

}
